import request from '../request'

// 发票列表
export function findPage(params) {
  return request({
    url: '/report/invoiceRecords/findPage',
    method: 'POST',
    data: params
  })
}

// 新建、编辑
export function saveOrUpdate(params) {
  return request({
    url: '/report/invoiceRecords/saveOrUpdate',
    method: 'POST',
    data: params
  })
}

// 删除
export function remove(params) {
  return request({
    url: `/report/invoiceRecords/remove?id=${params.id}`,
    method: 'delete',
    params
  })
}

export function download(parms) {
  return request({
    url: `/report/invoiceRecords/download`,
    method: 'get',
    parms,
    responseType: 'blob'
  })
}

// 修改密码
export function changePassword(params) {
  return request({
    url: '/report/sysUser/changePassword',
    method: 'POST',
    data: params
  })
}

// 用户列表
export function userfindPage(params) {
  return request({
    url: '/report/sysUser/findPage',
    method: 'POST',
    data: params
  })
}

// 新建用户
export function createUser(params) {
  return request({
    url: '/report/sysUser/createUser',
    method: 'POST',
    data: params
  })
}

// 获取角色下拉
export function getRoleList(params) {
  return request({
    url: '/report/sysRole/getRoleList',
    method: 'get',
    params
  })
}

// 删除用户
export function removeUser(params) {
  return request({
    url: `/report/sysUser/remove?id=${params.id}`,
    method: 'delete',
    params
  })
}

// 修改密码
export function renew(params) {
  return request({
    url: `/report/sysUser/renew`,
    method: 'post',
    data: params
  })
}

// 改变状态
export function replaceStatus(params) {
  return request({
    url: `/report/sysUser/replaceStatus`,
    method: 'get',
    params
  })
}

